<template>
  <router-link class="img-item" tag="li" :to="`${path}/${song.id}`">
    <img :src="song.picUrl" alt="" />
    <span class="icon">{{ song.playCount | formatNum(2) }}</span>
    <h5>{{ song.name }}</h5>
  </router-link>
</template>

<script>
export default {
  props: {
    song: {
      type: Object,
    },
    path: {
      type: String,
      default: "",
    },
  },
};
</script>

<style lang="less" scoped>
.img-item {
  width: 33%;
  position: relative;

  img {
    width: 100%;
    display: block;
  }
  .icon {
    position: absolute;
    top: 0px;
    right: 0px;
    color: white;
    background-image: url();
    background-repeat: no-repeat;
    background-size: 13px;
    background-position: left center;
    padding: 2px 0px 0px 14px;
  }
  h5 {
    overflow: hidden;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 6px 2px 10px 6px;
  }
}
</style>